// *Author：jxx
// *Contact：283591387@qq.com
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
export default function(){
    const table = {
        key: 'Id',
        footer: "Foots",
        cnName: '班组设置',
        name: 'Teams',
        url: "/Teams/",
        sortName: "Id"
    };
    const tableName = table.name;
    const tableCNName = table.cnName;
    const newTabEdit = false;
    const key = table.key;
    const editFormFields = {"TeamCode":"","TeamName":"","TeamType":"","Remark":"","autoCreate":0};
    const editFormOptions = [[{
        title: "班组编码",
        field: "TeamCode",
        type: "text",
        required: true,
        colSize: 8,
        width: 500,
        maxlength: 20
    },{
        title: "",
        field: "autoCreate",
        type: "switch",
        value: 0,
        colSize: 4,
        onChange: (val, option) => {
            if (val) {
                option.data.TeamCode = 'T' + Math.floor(Math.random() * 900 + 100);
            }
        },
        extra: {
            style: "margin-left: 5px;display: inline-flex;align-items: center;"
        }
    }],
                              [{"title":"班组名称","field":"TeamName","type":"text","required": true,"colSize":12,"maxlength": 50}],
                              [{"dataKey":"班组类型","data":[],"title":"班组类型","field":"TeamType","type":"select","required": true,"colSize":12}],
                              [{"title":"备注","field":"Remark","type":"textarea","colSize":12,"maxlength": 200,"validator": (rule, val) => {
    if (val && val.trim().length < 2) {
        return "备注内容至少输入2个字符";
    }
    return "";
}}]];
    const searchFormFields = {"TeamCode":"","TeamName":"","TeamType":""};
    const searchFormOptions = [[{"title":"班组编码","field":"TeamCode"},{"title":"班组名称","field":"TeamName"},{"dataKey":"班组类型","data":[],"title":"班组类型","field":"TeamType","type":"select"}]];
    const columns = [{field:'Id',title:'主键',type:'int',width:120,require:true,align:'left'},
                       {field:'TeamCode',title:'班组编码',type:'string',width:120,align:'left'},
                       {field:'TeamName',title:'班组名称',type:'string',width:120,align:'left'},
                       {field:'TeamType',title:'班组类型',type:'string',bind:{ key:'班组类型',data:[]},width:120,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:120,align:'left'}];
    const detail ={columns:[]};
    const details = [];

    return {
        table,
        key,
        tableName,
        tableCNName,
        newTabEdit,
        editFormFields,
        editFormOptions,
        searchFormFields,
        searchFormOptions,
        columns,
        detail,
        details
    };
}